<!--
 * @Descripttion:
 * @Author: Silence
 * @Date: 2023-08-12 17:36:07
 * @LastEditors: Silence
 * @LastEditTime: 2023-08-14 16:54:36
-->
<template>
  <div class="Pagination">
    <div class="text">
      <span>共{{ counts.totalCount }}条数据</span>
      <span>第{{ pages.pageIndex }}/{{ counts.totalPage }}页</span>
    </div>
    <div class="btn">
      <el-button :disabled="pages.pageIndex==1?true:false" @click="btn(-1)">上一页</el-button>
      <el-button :disabled="pages.pageIndex==counts.totalPage?true:false" @click="btn(1)">下一页</el-button>
    </div>
  </div>
</template>
<script>
export default {
  name: '',
  props: {
    // page: {
    //   type: Number,
    //   default: 1
    // },
    pages: {
      type: Object,
      default: () => {}
    },
    counts: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {

    }
  },
  computed: {
  },
  created() {
  },
  methods: {
    btn(e) {
      this.pages.pageIndex = this.pages.pageIndex + e
      this.$emit('update')
    }
  }
}
</script>
<style lang="scss">
.btn{
    button{
      width: 70px;
      height: 32px;
      padding: 0;
      border: 1px solid transparent;
      font-size: 13px;
      color: #606266;
      background-color: #d5ddf8;
      &:nth-child(1){
        margin-right: 20px;
      }
    }
  }
</style>
<style lang='scss'  scoped>
.Pagination{
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 20px;
  .text{
    color: #dbdfe5;
    span:nth-child(1){
      padding-right: 7px;
    }
  }
}
</style>
